package com.yaowk.sfp.file.api;

import com.yaowk.sfp.common.base.PageReq;
import com.yaowk.sfp.common.base.PageResp;
import com.yaowk.sfp.file.api.model.FileModel;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件管理接口
 *
 * @author 小凯
 **/
@FeignClient("file")
@RequestMapping("file")
public interface FileApi {

    @PostMapping
    FileModel upload(MultipartFile file);

    @GetMapping("{id}")
    FileModel findOne(@PathVariable Long id);

    @GetMapping
    PageResp<FileModel> findAll(FileModel fileModel, PageReq pageReq);

}
